package behavior.visitor;

import java.util.ArrayList;
import java.util.List;

public class ObjectStructure {
    List<Person> personList = new ArrayList<Person>();

    void attach(Person person){
        personList.add(person);
    }
    void detach(Person person){
        personList.remove(person);
    }
    void display(Action action){
        for (Person person: personList) {
            person.accept(action);
        }
    }

}
